<?php
class TypeModel extends Model{
	
	public $table='type';
	
	public function add_type(){
		
		return $this->add();
	}
	
	public function get_all_data(){
		
		return $this->all();
	}
	
	public function delete_data($where=null){
		
		K('Tproperty')->delete_data(array('tid'=>Q('get.tid')));
		
		K('Category')->delete_data(array('tid'=>Q('get.tid')));
				
		return $this->where($where)->delete();
	}
	
	
	public function get_one_data($where=null){
		
		return $this->where($where)->find(); 
	}
	
	
	public function edit_data($where=null){
		
		return $this->where($where)->update();
	}
	
}

